﻿@model Angel.Web.Models.CreateGroupModel

@{
    ViewBag.Title = "Groups";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Angel.js")" type="text/javascript"></script>
<body id="jira" class="aui-layout aui-theme-default page-type-admin ">
<div id="page">
<section id="content" role="main">
    <header>
        <h1 id="admin-page-heading">Groups</h1>
        <div id="upm-notifications" class="aui-dd-parent upm-admin-headers upm-notifications-jira dd-allocated loaded"><a title="Plugin Notifications" id="upm-notifications-trigger" class="aui-dd-trigger" href="#"><span id="upm-notifications-icon"></span><span id="upm-notifications-count">0</span></a>
            <div id="upm-notifications-dropdown" class="upm-notifications-dropdown aui-dropdown hidden"><h3>Plugin Notifications</h3><p id="upm-no-notifications">There are no plugins requiring your attention at this time.</p>
            </div>
        </div>
	</header>          
    <div class="content-container">               
        <div class="content-body aui-panel">
            <table class="jiraform jirapanel  maxWidth">
                <tbody>
                    <tr>
                        <td class="jiraformheader">
                            <a class="help-lnk" href="#" target="_jirahelp">         
                            <img src="../../Content/images/ico_help.png" align="right" border="0" height="16" width="16"/>      
                            <h3 class="formtitle">Groups</h3>       
                        </td>
                    </tr>
                    <tr>
                        <td class="jiraformbody">  
                            <p>The Group Browser allows you to browse all the groups in the system.   
                                You can also add and remove groups from here.
                                Only System Administrators are allowed to delete or edit members of groups with the 'System Administrators' permission.   
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td class="jiraformheader">
                             <h4 class="formtitle" style=" font-size:small ">Filter Group</h4>      
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td class="jiraformheader formtitle">
                            <table>
                                <tbody>
                                    <tr>
                                        <td>Groups Per Page</td>
                                        <td>Name Contains</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <select name="max" id="max">
	                                                <option value="10">
                                                        10
                                                    </option>
	                                                <option value="20" selected="">
                                                        20
                                                    </option>
	                                                <option value="50">
                                                        50
                                                    </option>
	                                                <option value="100">
                                                        100
                                                    </option>
                                            </select>
                                        </td>
                                        <td>
                                            <input name="nameFilter" id="nameFilter" size="20" type="text" value="" />
                                            <script type="text/javascript">
                                                $(document).ready(function ()
                                                {
                                                    $("#nameFilter").keydown(function (event)
                                                    {
                                                        if (event.which == 13)
                                                        {
                                                            filterGroup(0);
                                                        }
                                                    });
                                                });
                                                $(document).ready(function ()
                                                {
                                                    $("#max").keydown(function (event)
                                                    {
                                                        if (event.which == 13)
                                                        {
                                                            filterGroup(0);
                                                        }
                                                    });
                                                });
                                            </script>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td class="jiraformheader formtitle">
                            <div class="buttons-container form-footer" >
                                <div class="buttons">
                                    <button class="aui-button" id="Filter" value="Filter" onclick="filterGroup(0)">Filter</button>
                                    @*<input class="aui-button" value="Filter" type="submit">*@
                                    <a class="aui-button-cancel" href="">Reset Filter</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br />
            <div id="searchResult">
                <script type="text/javascript">
                    //searchGroup(0);
                    filterGroup(0)
                </script>
            </div>
            @using (Html.BeginForm("Index", "Group", FormMethod.Post, new { @id = "add-group", @class = "aui add-group" }))
            {
            @Html.ValidationSummary(true)
                  <div class="form-body">
                        <h3>Add Group</h3>
                        <div class="field-group">
  
                            <label>Name</label>
                            @Html.TextBoxFor(model => model.NameGroup, new { size = 29 })
                           
                            <span style="color:Red;padding-left:5px;">@Html.ValidationMessageFor(model => model.NameGroup)</span>
                                 
                            <span style="color:Red;padding-left:5px;">@ViewBag.MessageError</span>
                        </div>
                   </div>
                   <div class="buttons-container form-footer">
                        <div class="buttons">
                            <input class="aui-button" name="add_group" value="Add Group" type="submit"/>
                        </div>
                   </div>
            }
        </div>
    </div>       
</section>
</body>
